/*
 * Formula Parser
 * @Version: GUI version for ABSL
 * @Created by Hao Ji
 */

package de.parser.gui;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import parser.Parser;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JRadioButton;
import javax.swing.JTextArea;
import javax.swing.JTextField;

class MyCustomFilter extends javax.swing.filechooser.FileFilter {
        @Override
        public boolean accept(File file) {
            // Allow only directories, or files with ".txt" extension
            return file.isDirectory() || file.getAbsolutePath().endsWith(".txt");
        }
        @Override
        public String getDescription() {
            // This description will be displayed in the dialog,
            // hard-coded = ugly, should be done via I18N
            return "Text documents (*.txt)";
        }
    } 
class RadioListener implements ActionListener{
 private JTextArea textField;
 public RadioListener(JTextArea textField){
     
        this.textField = textField;
        
    }
    @Override
    public void actionPerformed(ActionEvent ae) {
        JRadioButton button = (JRadioButton) ae.getSource();
        if(button.isSelected()){
            textField.setEditable(true);
        }
        else
            textField.setEditable(false);
       //To change body of generated methods, choose Tools | Templates.
    }
    
}

/**
 *
 * @author Info
 */
public class FormulerParser extends javax.swing.JFrame {

    /**
     * Creates new form FormulerParser
     */
    public FormulerParser() {
        initComponents();
          RadioListener inlist = new RadioListener(incontent);
          inedit.addActionListener(inlist);
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        fileChooser = new javax.swing.JFileChooser();
        fileChooser1 = new javax.swing.JFileChooser();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        incontent = new javax.swing.JTextArea();
        insave = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        outcontent = new javax.swing.JTextArea();
        outsave = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        bparse = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        inputpath = new javax.swing.JTextField();
        binputslt = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        outputpath = new javax.swing.JTextField();
        boutputslt = new javax.swing.JButton();
        bdisplay = new javax.swing.JButton();
        inedit = new javax.swing.JRadioButton();
        outedit = new javax.swing.JRadioButton();
        jLabel5 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        menuInputSlt = new javax.swing.JMenuItem();
        menuOutputSlt = new javax.swing.JMenuItem();
        menuClose = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();

        fileChooser.setFileFilter( new MyCustomFilter());

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Formula Parser");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Input Content", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 12))); // NOI18N

        incontent.setColumns(20);
        incontent.setRows(5);
        jScrollPane1.setViewportView(incontent);

        insave.setText("Save");
        insave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                insaveActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 609, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(278, 278, 278)
                        .addComponent(insave)))
                .addContainerGap(18, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 261, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(insave)
                .addGap(388, 388, 388))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Output Content", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 12))); // NOI18N

        outcontent.setColumns(20);
        outcontent.setRows(5);
        jScrollPane2.setViewportView(outcontent);

        outsave.setText("Save");
        outsave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                outsaveActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 610, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(129, 129, 129))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(309, 309, 309)
                .addComponent(outsave)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(outsave)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        bparse.setText("Parse");
        bparse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bparseActionPerformed(evt);
            }
        });

        jLabel1.setText("Input File Path:");

        binputslt.setText("Select");
        binputslt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                binputsltActionPerformed(evt);
            }
        });

        jLabel2.setText("Output File Path:");

        boutputslt.setText("Select");
        boutputslt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boutputsltActionPerformed(evt);
            }
        });

        bdisplay.setText("Display Result");
        bdisplay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bdisplayActionPerformed(evt);
            }
        });

        inedit.setText("Input Edit");
        inedit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ineditActionPerformed(evt);
            }
        });

        outedit.setText("Output Edit");
        outedit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                outeditActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(outputpath, javax.swing.GroupLayout.PREFERRED_SIZE, 418, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(inputpath, javax.swing.GroupLayout.PREFERRED_SIZE, 418, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(binputslt)
                    .addComponent(boutputslt))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(bparse)
                .addGap(42, 42, 42)
                .addComponent(bdisplay)
                .addGap(181, 181, 181)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(inedit)
                    .addComponent(outedit))
                .addGap(84, 84, 84))
        );

        jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2});

        jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {bdisplay, binputslt, boutputslt, bparse});

        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(bparse, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                        .addComponent(inedit)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(outedit)
                        .addGap(0, 4, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(inputpath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(binputslt))
                        .addGap(1, 1, 1)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(outputpath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(boutputslt)))
                    .addComponent(bdisplay, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N
        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/de/parser/gui/Untitled-5.png"))); // NOI18N

        jMenu1.setText("File");

        menuInputSlt.setText("Select Input File");
        jMenu1.add(menuInputSlt);

        menuOutputSlt.setText("Select Output File");
        jMenu1.add(menuOutputSlt);

        menuClose.setText("Close");
        menuClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCloseActionPerformed(evt);
            }
        });
        jMenu1.add(menuClose);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");

        jMenuItem3.setText("Save Input");
        jMenu2.add(jMenuItem3);

        jMenuItem4.setText("Save Output");
        jMenu2.add(jMenuItem4);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Parse");

        jMenuItem1.setText("Parse");
        jMenu3.add(jMenuItem1);

        jMenuItem2.setText("Display");
        jMenu3.add(jMenuItem2);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 646, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 1336, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 32, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5)
                .addGap(29, 29, 29)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 24, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void menuCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCloseActionPerformed
        // TODO add your handling code here:
        System.exit(0); 
    }//GEN-LAST:event_menuCloseActionPerformed

    private void binputsltActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_binputsltActionPerformed
        // TODO add your handling code here:
        
          int returnVal = fileChooser.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = fileChooser.getSelectedFile();
        try {
           
          // What to do with the file, e.g. display it in a TextArea
          inputpath.setText(file.getAbsolutePath());
          incontent.read( new FileReader( file.getAbsolutePath() ), null );
          incontent.setEditable(false);
      
        } catch (IOException ex) {
          System.out.println("problem accessing file"+file.getAbsolutePath());
        }
    } else {
        System.out.println("File access cancelled by user.");
    }
    }//GEN-LAST:event_binputsltActionPerformed

    private void boutputsltActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boutputsltActionPerformed
        // TODO add your handling code here: 
        fileChooser1.setCurrentDirectory(new java.io.File("."));
fileChooser1.setDialogTitle("choosertitle");
fileChooser1.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fileChooser1.setAcceptAllFileFilterUsed(false);

//if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
//  System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory());
//  System.out.println("getSelectedFile() : " + chooser.getSelectedFile());
//} else {
//  System.out.println("No Selection ");
//}
        int returnVal = fileChooser1.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = fileChooser1.getSelectedFile();
        outputpath.setText(file.getAbsolutePath());
    } else {
        System.out.println("File access cancelled by user.");
    }
    }//GEN-LAST:event_boutputsltActionPerformed

    private void bparseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bparseActionPerformed
        // TODO add your handling code here:
        if(inputpath.getText().isEmpty()){
            JOptionPane.showMessageDialog(this,"Select the Input file path","Error Message",JOptionPane.ERROR_MESSAGE); 
        }
        if(outputpath.getText().isEmpty()){
            JOptionPane.showMessageDialog(this,"Select the Output file path","Error Message",JOptionPane.ERROR_MESSAGE); 
        }
        Parser parser= new Parser();
        parser.parseResult(inputpath.getText(), outputpath.getText());
        JOptionPane.showMessageDialog(this,"Parse is done","Information",JOptionPane.INFORMATION_MESSAGE);
    }//GEN-LAST:event_bparseActionPerformed

    private void bdisplayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bdisplayActionPerformed
        try {
            // TODO add your handling code here:
            
            outcontent.read( new FileReader( outputpath.getText()+"/result.txt"), null );
             outcontent.setEditable(false);
          RadioListener outlist = new RadioListener(outcontent);
          outedit.addActionListener(outlist);
        } catch (IOException ex) {
            Logger.getLogger(FormulerParser.class.getName()).log(Level.SEVERE, null, ex);
        }
     
    }//GEN-LAST:event_bdisplayActionPerformed

    private void ineditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ineditActionPerformed
        // TODO add your handling code here:
        
    }//GEN-LAST:event_ineditActionPerformed

    private void outeditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outeditActionPerformed
        // TODO add your handling code here:
        
    }//GEN-LAST:event_outeditActionPerformed

    private void insaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insaveActionPerformed
        // TODO add your handling code here:
         if(inputpath.getText().isEmpty()){
            JOptionPane.showMessageDialog(this,"Select the Input file path","Error Message",JOptionPane.ERROR_MESSAGE); 
        }
         else{
        Parser parser= new Parser();
        parser.modifyResult(inputpath.getText(), incontent.getText());}
        
    }//GEN-LAST:event_insaveActionPerformed

    private void outsaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_outsaveActionPerformed
        // TODO add your handling code here:
         if(outputpath.getText().isEmpty()){
            JOptionPane.showMessageDialog(this,"Select the Output file path","Error Message",JOptionPane.ERROR_MESSAGE); 
        }
         else{
         Parser parser= new Parser();
        parser.writeResult(outputpath.getText(), outcontent.getText());}
    }//GEN-LAST:event_outsaveActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FormulerParser.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FormulerParser.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FormulerParser.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FormulerParser.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FormulerParser().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bdisplay;
    private javax.swing.JButton binputslt;
    private javax.swing.JButton boutputslt;
    private javax.swing.JButton bparse;
    private javax.swing.JFileChooser fileChooser;
    private javax.swing.JFileChooser fileChooser1;
    private javax.swing.JTextArea incontent;
    private javax.swing.JRadioButton inedit;
    private javax.swing.JTextField inputpath;
    private javax.swing.JButton insave;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JMenuItem menuClose;
    private javax.swing.JMenuItem menuInputSlt;
    private javax.swing.JMenuItem menuOutputSlt;
    private javax.swing.JTextArea outcontent;
    private javax.swing.JRadioButton outedit;
    private javax.swing.JTextField outputpath;
    private javax.swing.JButton outsave;
    // End of variables declaration//GEN-END:variables
}
